/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package by.vdl.websort.server.dao.rowmapper;

import by.vdl.websort.server.entity.ItemDTO;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author zeor
 */
public class ItemRowMapper implements RowMapper<ItemDTO>{

    public ItemDTO mapRow(ResultSet rs, int i) throws SQLException {
        ItemDTO itemDTO = new ItemDTO();
        itemDTO.setId(rs.getLong("id"));
        itemDTO.setName(rs.getString("name"));
        itemDTO.setStudyId(rs.getLong("study_id"));
        
        return itemDTO;
    }
    
}
